<template>
	<view class="AuthModel">

		<view v-if="userPinia.isLoginType==3" @click="addCardType(1)" class="conent u-flex u-p-l-28 u-p-t-28 u-p-b-28 u-p-r-12 u-m-t-52">
			<view class="items u-p-r-16 u-flex-1">
				<u-icon label-pos="left" label-size="32" label-color="#303133" color="#62d48c" label="企业/公司"
					name="play-right-fill"></u-icon>
				<view class="desc">适用营业执照名称或类型包含有限公司、股份有限公司、自然人独资等</view>
			</view>
			<u-image shape="circle" width="150" height="150" src="@/static/images/my/qy.png"></u-image>
		</view>

		<view @click="addCardType(2)" class="conent u-flex u-p-l-28 u-p-t-28 u-p-b-28 u-p-r-12 ">
			<view class="items u-p-r-16 u-flex-1">
				<u-icon label-pos="left" label-size="32" label-color="#303133" color="#62d48c" label="个体工商户"
					name="play-right-fill"></u-icon>
				<view class="desc">适用营业执照或者类型包括个体商户、个人独资企业</view>
			</view>
			<u-image shape="circle" width="150" height="150" src="@/static/images/my/gt.png"></u-image>
		</view>
	</view>
</template>

<script setup>
	import userSotre from '@/store/user';
	import {
		onShow
	} from '@dcloudio/uni-app';
	import userApi from '@/api/user';
	import {
		ref
	} from "vue";
	const userPinia = userSotre()


	const isTrue = ref(false)
	onShow(() => {


		userApi.getAccountInfo().then(res => {
			 if(!uni.$u.test.isEmpty(res.data)){
				 isTrue.value = true
			 }
		})
	})

	function addCardType(index) {
		let obj = {
			type: index,
		}

		if (isTrue.value) {
			obj.update = true
		}

		uni.$u.route({
			url: '/subpackage/my/fund/userAuth',
			params: obj
		})
	}
</script>

<style lang="scss" scoped>
	.AuthModel {
		// width: 720upx;
		background-color: #f6f6f6;
		overflow: hidden;

		.head {
			width: 100%;
			// height: 120upx;
			position: relative;
		}

		.head::after {
			content: '身份验证';
			display: block;
			// line-height: 120upx;
			font-size: 34upx;
			color: white;
			text-align: center;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
		}

		.conent {
			margin: 28upx;
			background-color: white;

			.items {
				background-color: white;
				border-radius: 14upx;

				.desc {
					margin-top: 16upx;
					font-size: 26upx;
					color: #909399;
				}
			}
		}

	}
</style>
